import request from "../utils/request";

// 获取首页
export const getTaxiIndexAPI = (data) => {
  return request({
    url:`/CarpoolService/carpoolSimple/queryCarPoolInfoList`,
    method:'GET',
    data
  })
}
// 查询出行计划表
export const getUserCarOrdersAPI = (userId) => {
  return request({
    url:`/CarpoolService/carOrders/queryByUserId`,
    method:'GET',
    data:{
      userId
    }
  })
}
// 发布拼车信息
export const publishCarAPI = (data) => {
  return request({
    url:`/CarpoolService/carpoolDetail/createcarpool`,
    method:'POST',
    data
  })
}
// 查询车次订单 
export const getCarOrderAPI = (carpoolId) => {
  return request({
    url:`/CarpoolService/carOrders/orderDetail`,
    method:'GET',
    data:{
      carpoolId
    }
  })
}
// 查询用户乘车人列表 
export const getRiderAPI = (userId) => {
  return request({
    url:`/CarpoolService/passenger/userList/${userId}`,
    method:'GET'
  })
}
// 添加乘车人 
export const addRiderAPI = (data) => {
  return request({
    url:`/CarpoolService/passenger`,
    method:'POST',
    data
  })
}
// 修改乘车人 
export const putRiderAPI = (data) => {
  return request({
    url:`/CarpoolService/passenger`,
    method:'PUT',
    data
  })
}

// 获始发地模糊搜索
export const getQueryAddress = (data) => {
  return request({
    url:`/CarpoolService/carpoolSimple/queryAddress`,
    method:'GET',
    data
  })
}

// 添加订单乘车人 
export const addOrderRiderAPI = (data) => {
  return request({
    url:`/CarpoolService/carpoolPassenger`,
    method:'POST',
    data
  })
}

// 删除订单乘车人 
export const delOrderRiderAPI = (data) => {
  return request({
    url:`/CarpoolService/carpoolPassenger`,
    method:'DELETE',
    data
  })
}